package com.cqc.manage.controller;


import com.cqc.manage.dto.EquRecordDto;
import com.cqc.manage.dto.JsonResultDto;
import com.cqc.manage.entity.Equipment;
import com.cqc.manage.service.Imp.equipmentService.EquRecordService;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/equRecord")
public class EquipmentRecordController {

    private Logger logger = LoggerFactory.getLogger(EquipmentRecordController.class);

    @Autowired
    private EquRecordService equRecordService;

    /**
     * 插入多设备记录
     * @return
     */
    @ApiOperation(value = "插入多条是设备记录",notes = "插入多条是设备记录")
    @RequestMapping(value = "/insertEquRecord",method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
    public JsonResultDto getAllEqu(@RequestBody List<EquRecordDto> equRecordDtoList){
        logger.info("插入多条设备使用记录：{}",equRecordDtoList);
        equRecordService.addMultipleEquRecord(equRecordDtoList);
        return new JsonResultDto("200","success");
    }









}
